home *** CD-ROM | disk | FTP | other *** search
/ Quick PC 62 / Quick PC 62.iso / I386 / IIS5_01.CAB / IIS_Variables_JScript.asp < prev    next >
Encoding:
Text File  |  1998-05-29  |  1.8 KB  |  94 lines

  1. <%@ LANGUAGE = JScript %>
  2.  
  3. <!*************************
  4. This sample is provided for educational purposes only. It is not intended to be 
  5. used in a production environment, has not been tested in a production environment, 
  6. and Microsoft will not provide technical support for it. 
  7. *************************>
  8.  
  9. <HTML>
  10.     <HEAD>
  11.         <TITLE>Variable Sample</TITLE>
  12.     </HEAD>
  13.  
  14.     <BODY BGCOLOR="White" TOPMARGIN="10" LEFTMARGIN="10">
  15.  
  16.         <!-- Display header. -->
  17.  
  18.         <FONT SIZE="4" FACE="Arial, Helvetica">
  19.         <B>Variable Sample</B></FONT><BR>
  20.       
  21.       
  22.         <HR>
  23.         <H3>Integer Manipulation</H3>
  24.  
  25.         <%
  26.             //Declare variable.
  27.             var intVar;
  28.  
  29.             //Assign the variable an integer value.
  30.             intVar = 5;
  31.         %>
  32.  
  33.         <P><%= intVar %> + <%= intVar %> =
  34.         <%= intVar + intVar %></P>
  35.  
  36.  
  37.         <HR>
  38.         <H3>String Manipulation</H3>
  39.  
  40.         <%
  41.             //Declare variable.
  42.             var strVar;
  43.  
  44.             //Assign the variable a string value.
  45.             strVar = "Jemearl";
  46.         %>
  47.  
  48.         <P>This example was done by <%= strVar + " Smith" %></P>        
  49.  
  50.         <HR>
  51.         <H3>Boolean Manipulation</H3>
  52.  
  53.         <%
  54.             //Declare variable.
  55.             var blnVar;
  56.  
  57.             //Assign the variable a boolean value.
  58.             blnVar = true;
  59.  
  60.             //Output Message based on value.
  61.             if (blnVar)
  62.                 {
  63.               Response.Write("<P>The boolean value is True.</P>");
  64.             }
  65.             else
  66.             {
  67.               Response.Write("<P>The boolean value is False.</P>");
  68.             }
  69.         %>
  70.         
  71.         <HR>
  72.         <H3>Date and Time</h3>
  73.  
  74.         <%
  75.             //Declare variable.
  76.             var dtmVar;
  77.  
  78.             //Assign the variable a value.
  79.             dtmVar = new Date(1997, 8, 27, 17, 11, 42);
  80.         %>
  81.  
  82.         <P>The date and time is <%= dtmVar %> </p>
  83.  
  84.         <%
  85.             //Set the variable to the web server date and time.
  86.             dtmVar = new Date();
  87.         %>
  88.  
  89.         <P>The <STRONG>system</STRONG> date and time
  90.         is <%= dtmVar %></P>
  91.  
  92.     </BODY>
  93. </HTML>
  94.